%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for queries/interfaces-via-union-all/vulnerabilitiesConnection"
    Bucket0("Bucket 0 (root)<br /><br />1: <br />ᐳ: 9, 10, 12, 24, 11<br />2: PgUnionAll[8]<br />ᐳ: Access[19]<br />3: Connection[13]<br />4: ConnectionItems[14]"):::bucket
    Bucket1("Bucket 1 (nullableBoundary)<br />Deps: 13, 19, 24, 14, 11<br /><br />ROOT Connectionᐸ8ᐳ[13]"):::bucket
    Bucket3("Bucket 3 (listItem)<br />Deps: 19, 24, 11<br /><br />ROOT __Item{3}ᐸ14ᐳ[17]"):::bucket
    Bucket4("Bucket 4 (nullableBoundary)<br />Deps: 26, 18, 11, 28, 20<br /><br />ROOT Edge{3}[18]"):::bucket
    Bucket5("Bucket 5 (polymorphic)<br />__typename: Access[27]<br />Deps: 27, 11, 28"):::bucket
    Bucket6("Bucket 6 (polymorphicPartition)<br />|FirstPartyVulnerability<br />Deps: 11, 28<br />ᐳFirstPartyVulnerability<br /><br />1: PgSelect[29]<br />2: PgSelectRows[34]<br />ᐳ: 33, 35, 44, 46, 48, 50"):::bucket
    Bucket7("Bucket 7 (polymorphicPartition)<br />|ThirdPartyVulnerability<br />Deps: 11, 28<br />ᐳThirdPartyVulnerability<br /><br />1: PgSelect[37]<br />2: PgSelectRows[42]<br />ᐳ: 41, 43, 45, 47, 49, 51"):::bucket
    end
    Bucket0 --> Bucket1
    Bucket1 --> Bucket3
    Bucket3 --> Bucket4
    Bucket4 --> Bucket5
    Bucket5 --> Bucket6 & Bucket7

    %% plan dependencies
    PgUnionAll8[["PgUnionAll[8∈0] ➊<br />ᐸFirstPartyVulnerability,ThirdPartyVulnerabilityᐳ<br />More deps:<br />- Object[11]<br />- Constantᐸ[Function: applyInputConstant]ᐳ[12]"]]:::plan
    Object11{{"Object[11∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ<br />Dependents: 3"}}:::plan
    Access9{{"Access[9∈0] ➊<br />ᐸ2.pgSettingsᐳ"}}:::plan
    Access10{{"Access[10∈0] ➊<br />ᐸ2.withPgClientᐳ"}}:::plan
    Access9 & Access10 --> Object11
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ"]:::plan
    __Value2 --> Access9
    __Value2 --> Access10
    Connection13[["Connection[13∈0] ➊<br />ᐸ8ᐳ"]]:::plan
    PgUnionAll8 --> Connection13
    ConnectionItems14[["ConnectionItems[14∈0] ➊"]]:::plan
    Connection13 --> ConnectionItems14
    Access19{{"Access[19∈0] ➊<br />ᐸ8.cursorDetailsᐳ"}}:::plan
    PgUnionAll8 --> Access19
    List25{{"List[25∈3]<br />ᐸ22,23,24ᐳ<br />More deps:<br />- Constantᐸ[HIDDEN]ᐳ[24]"}}:::plan
    Access22{{"Access[22∈3]<br />ᐸ17.0ᐳ"}}:::plan
    Access23{{"Access[23∈3]<br />ᐸ17.1ᐳ"}}:::plan
    Access22 & Access23 --> List25
    Edge18{{"Edge[18∈3]"}}:::plan
    __Item17[/"__Item[17∈3]<br />ᐸ14ᐳ"\]:::itemplan
    PgCursor20{{"PgCursor[20∈3]"}}:::plan
    __Item17 & PgCursor20 --> Edge18
    __Item17 & Access19 --> PgCursor20
    ConnectionItems14 ==> __Item17
    __Item17 --> Access22
    __Item17 --> Access23
    Lambda26{{"Lambda[26∈3]<br />ᐸtoSpecifierᐳ"}}:::plan
    List25 --> Lambda26
    Access28{{"Access[28∈3]<br />ᐸ26.idᐳ"}}:::plan
    Lambda26 --> Access28
    Access27{{"Access[27∈4]<br />ᐸ26.__typenameᐳ"}}:::plan
    Lambda26 --> Access27
    PgSelect29[["PgSelect[29∈6]<br />ᐸfirst_party_vulnerabilitiesᐳ<br />ᐳFirstPartyVulnerability<br />More deps:<br />- Object[11]"]]:::plan
    Access28 --> PgSelect29
    First33{{"First[33∈6]^"}}:::plan
    PgSelectRows34[["PgSelectRows[34∈6]^"]]:::plan
    PgSelectRows34 --> First33
    PgSelect29 --> PgSelectRows34
    PgSelectSingle35{{"PgSelectSingle[35∈6]^<br />ᐸfirst_party_vulnerabilitiesᐳ"}}:::plan
    First33 --> PgSelectSingle35
    PgClassExpression44{{"PgClassExpression[44∈6]^<br />ᐸ__first_pa...vss_score”ᐳ"}}:::plan
    PgSelectSingle35 --> PgClassExpression44
    PgClassExpression46{{"PgClassExpression[46∈6]^<br />ᐸ__first_pa...ies__.”id”ᐳ"}}:::plan
    PgClassExpression44 o--o PgClassExpression46
    PgClassExpression48{{"PgClassExpression[48∈6]^<br />ᐸ__first_pa...s__.”name”ᐳ"}}:::plan
    PgClassExpression46 o--o PgClassExpression48
    PgClassExpression50{{"PgClassExpression[50∈6]^<br />ᐸ__first_pa...team_name”ᐳ"}}:::plan
    PgClassExpression48 o--o PgClassExpression50
    PgSelect37[["PgSelect[37∈7]<br />ᐸthird_party_vulnerabilitiesᐳ<br />ᐳThirdPartyVulnerability<br />More deps:<br />- Object[11]"]]:::plan
    Access28 --> PgSelect37
    First41{{"First[41∈7]^"}}:::plan
    PgSelectRows42[["PgSelectRows[42∈7]^"]]:::plan
    PgSelectRows42 --> First41
    PgSelect37 --> PgSelectRows42
    PgSelectSingle43{{"PgSelectSingle[43∈7]^<br />ᐸthird_party_vulnerabilitiesᐳ"}}:::plan
    First41 --> PgSelectSingle43
    PgClassExpression45{{"PgClassExpression[45∈7]^<br />ᐸ__third_pa...vss_score”ᐳ"}}:::plan
    PgSelectSingle43 --> PgClassExpression45
    PgClassExpression47{{"PgClassExpression[47∈7]^<br />ᐸ__third_pa...ies__.”id”ᐳ"}}:::plan
    PgClassExpression45 o--o PgClassExpression47
    PgClassExpression49{{"PgClassExpression[49∈7]^<br />ᐸ__third_pa...s__.”name”ᐳ"}}:::plan
    PgClassExpression47 o--o PgClassExpression49
    PgClassExpression51{{"PgClassExpression[51∈7]^<br />ᐸ__third_pa...ndor_name”ᐳ"}}:::plan
    PgClassExpression49 o--o PgClassExpression51

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value2,PgUnionAll8,Access9,Access10,Object11,Connection13,ConnectionItems14,Access19 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1 bucket1
    classDef bucket3 stroke:#ffa500
    class Bucket3,__Item17,Edge18,PgCursor20,Access22,Access23,List25,Lambda26,Access28 bucket3
    classDef bucket4 stroke:#0000ff
    class Bucket4,Access27 bucket4
    classDef bucket5 stroke:#7fff00
    class Bucket5 bucket5
    classDef bucket6 stroke:#ff1493
    class Bucket6,PgSelect29,First33,PgSelectRows34,PgSelectSingle35,PgClassExpression44,PgClassExpression46,PgClassExpression48,PgClassExpression50 bucket6
    classDef bucket7 stroke:#808000
    class Bucket7,PgSelect37,First41,PgSelectRows42,PgSelectSingle43,PgClassExpression45,PgClassExpression47,PgClassExpression49,PgClassExpression51 bucket7

